<script type="text/javascript" charset="utf-8">
  $(function () {
    $("input").uniform();
  });
</script>
<script type="text/javascript" src="<?php echo $this->baseUrl();?>/externals/tinymce/forum_style.js"></script>


<ul class="forum_topic_posts">
  <?php $i = -1; foreach ($this->paginator as $post): $i ++; ?>
    <li class="forum_post_<?php echo $i % 2; ?>">
      <div class="forum_topic_author">
        <?php $user = new Application_Model_User($post->user_id);?>
        <div class="forum_topic_author_name">
          <?php echo $user->getDisplayName();?>
        </div>
        <div class="forum_topic_author_photo">
          <?php echo $user->getProfilePhoto('thumb.normal');?>
        </div>
        <ul class="forum_topic_author_info">
          <li class="forum_topic_author_info_title">
            Группа: <?php echo $user->getRole();?>
          </li>
          <li>
            Регистрация: <?php echo $user->getCreationDate();?>
          </li>
          <li>
            Пол: <?php echo $user->getGender();?>
          </li>
        </ul>
      </div>
      <div class="forum_topic_info">
        <div class="forum_topic_info_top">
          <div class="forum_topic_info_top_anchor">
            <a href="#"> &nbsp; </a>
          </div>
          <div class="forum_topic_info_top_date">
            <?php echo $post->creation_date;?>
          </div>
          <div class="forum_topic_info_top_options">
            <?php if (Engine_Api::_()->application()->getViewer()): ?>
              <a class="buttonlink icon_forum_post_quote" href="<?php echo $this->url(array(
                'module' => 'forum',
                'controller' => 'post',
                'action' => 'quote',
                'post_id' => $post->post_id
              ), '', true);?>"> Цитата </a>
            <?php endif;?>
            <?php if (Engine_Api::_()->application()->isAdmin() || ($this->viewer && $post->user_id == $this->viewer->user_id)): ?>
              <a class="buttonlink icon_forum_post_edit" href="<?php echo $this->url(array(
                'module' => 'forum',
                'controller' => 'post',
                'action' => 'edit',
                'post_id' => $post->post_id
              ), '', true);?>"> Редактировать </a>

              <a class="buttonlink icon_forum_post_delete" href="<?php echo $this->url(array(
                'module' => 'forum',
                'controller' => 'post',
                'action' => 'delete',
                'post_id' => $post->post_id
              ), '', true);?>"> Удалить </a>
            <?php endif;?>
          </div>
        </div>
        <div class="forum_topic_info_body">
          <?php echo $post->body; ?>
        </div>
      </div>
    </li>
  <?php endforeach; ?>
</ul>

<?php echo $this->form; ?>